package org.rsbot.script.randoms;

import java.util.logging.Logger;
import org.rsbot.script.Random;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.methods.Game;
import org.rsbot.script.methods.Interfaces;
import org.rsbot.script.methods.Mouse;
import org.rsbot.script.wrappers.RSComponent;
import org.rsbot.script.wrappers.RSInterface;

@ScriptManifest(authors={"ToshiXZ"}, name="TeleotherCloser", version=1.0D)
public class TeleotherCloser extends Random
{
  public boolean activateCondition()
  {
    RSInterface localRSInterface = this.interfaces.get(326);
    return (localRSInterface.isValid()) && (localRSInterface.getComponent(2).getText().contains("wants to teleport"));
  }

  public int loop()
  {
    this.interfaces.get(326).getComponent(8).doClick();
    sleep(random(500, 750));
    this.game.openTab(12);
    sleep(random(500, 750));
    this.log.info("Disabling accept aid");
    this.mouse.click(random(569, 603), random(415, 440), false);
    return -1;
  }
}